export function gettree(list, rootpid) {
  const arr = []
  list.forEach(item => {
    if (item.pid === rootpid) {
      const children = gettree(list, item.id)
      if (children.length) item.children = children
      arr.push(item)
    }
    // console.log(arr)
  })
  return arr
}
